//
//  LFBSimulatorScanQRCodeController.m
//  loveFreshBeen
//
//  Created by Feng on 2017/7/11.
//  Copyright © 2017年 feng. All rights reserved.
//

#import "LFBSimulatorScanQRCodeController.h"
#import <Masonry.h>
#import "UILabel+Addition.h"

@interface LFBSimulatorScanQRCodeController ()

@end

@implementation LFBSimulatorScanQRCodeController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}

- (void)setupUI
{
    //框
    UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pick_bg"]];
    
    [self.view addSubview:bgImageView];
    [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.offset(0);
        make.height.width.offset(280);
    }];
    
    //线
    UIImageView *yellowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yellowlight"]];
    [yellowImageView setContentMode:UIViewContentModeScaleAspectFill];
    
    [self.view addSubview:yellowImageView];
    [yellowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.offset(0);
    }];
    
    //字
    UILabel *descLabel = [UILabel createLabelWithFontSize:17 andTextColor:[UIColor blackColor] andText:@"没有真机,玩个卵子"];
    [self.view addSubview:descLabel];
    [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(bgImageView.mas_bottom).offset(8);
        make.centerX.offset(0);
    }];
    
    //设置动画
    CABasicAnimation *basic = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
    basic.fromValue = @(-100);
    basic.toValue = @(100);
    basic.duration = 1.0;
    basic.repeatCount = INT_MAX;
    basic.removedOnCompletion = NO;
    basic.fillMode = kCAFillModeForwards;
    
    [yellowImageView.layer addAnimation:basic forKey:@"basic"];
    
    //设置title
    self.navigationItem.title = @"扫描二维码";
}

@end
